
/*
'===============================================================================
'  Generated From - CSharp_dOOdads_BusinessEntity.vbgen
' 
'  ** IMPORTANT  ** 
'  How to Generate your stored procedures:
' 
'  SQL        = SQL_StoredProcs.vbgen
'  ACCESS     = Access_StoredProcs.vbgen
'  ORACLE     = Oracle_StoredProcs.vbgen
'  FIREBIRD   = FirebirdStoredProcs.vbgen
'  POSTGRESQL = PostgreSQL_StoredProcs.vbgen
'
'  The supporting base class OleDbEntity is in the Architecture directory in "dOOdads".
'  
'  This object is 'abstract' which means you need to inherit from it to be able
'  to instantiate it.  This is very easilly done. You can override properties and
'  methods in your derived class, this allows you to regenerate this class at any
'  time and not worry about overwriting custom code. 
'
'  NEVER EDIT THIS FILE.
'
'  public class YourObject :  _YourObject
'  {
'
'  }
'
'===============================================================================
*/

// Generated by MyGeneration Version # (1.3.0.3)

using System;
using System.Data;
using System.Data.OleDb;
using System.Collections;
using System.Collections.Specialized;

using MyGeneration.dOOdads;

namespace Alserve.Ffl.Data
{
	public abstract class _Skip : OleDbEntity
	{
		public _Skip()
		{
			this.QuerySource = "Skip";
			this.MappingName = "Skip";

		}	

		//=================================================================
		//  public Overrides void AddNew()
		//=================================================================
		//
		//=================================================================
		public override void AddNew()
		{
			base.AddNew();
			
		}
		
		
		public override string GetAutoKeyColumn()
		{
			return "ID";
		}

		public override void FlushData()
		{
			this._whereClause = null;
			this._aggregateClause = null;
			base.FlushData();
		}
		
		//=================================================================
		//  	public Function LoadAll() As Boolean
		//=================================================================
		//  Loads all of the records in the database, and sets the currentRow to the first row
		//=================================================================
		public bool LoadAll() 
		{
			ListDictionary parameters = null;
			
			return base.LoadFromSql("[" + this.SchemaStoredProcedure + "proc_SkipLoadAll]", parameters);
		}
	
		//=================================================================
		// public Overridable Function LoadByPrimaryKey()  As Boolean
		//=================================================================
		//  Loads a single row of via the primary key
		//=================================================================
		public virtual bool LoadByPrimaryKey(int ID)
		{
			ListDictionary parameters = new ListDictionary();
			parameters.Add(Parameters.ID, ID);

		
			return base.LoadFromSql("[" + this.SchemaStoredProcedure + "proc_SkipLoadByPrimaryKey]", parameters);
		}
		
		#region Parameters
		protected class Parameters
		{
			
			public static OleDbParameter ID
			{
				get
				{
					return new OleDbParameter("@ID", OleDbType.Numeric, 0);
				}
			}
			
			public static OleDbParameter Keyword
			{
				get
				{
					return new OleDbParameter("@Keyword", OleDbType.VarWChar, 10);
				}
			}
			
			public static OleDbParameter SkipText
			{
				get
				{
					return new OleDbParameter("@SkipText", OleDbType.VarWChar, 255);
				}
			}
			
			public static OleDbParameter SkipDate
			{
				get
				{
					return new OleDbParameter("@SkipDate", OleDbType.Date, 0);
				}
			}
			
			public static OleDbParameter SkipNumber
			{
				get
				{
					return new OleDbParameter("@SkipNumber", OleDbType.Numeric, 0);
				}
			}
			
		}
		#endregion		
	
		#region ColumnNames
		public class ColumnNames
		{  
            public const string ID = "ID";
            public const string Keyword = "Keyword";
            public const string SkipText = "SkipText";
            public const string SkipDate = "SkipDate";
            public const string SkipNumber = "SkipNumber";

			static public string ToPropertyName(string columnName)
			{
				if(ht == null)
				{
					ht = new Hashtable();
					
					ht[ID] = _Skip.PropertyNames.ID;
					ht[Keyword] = _Skip.PropertyNames.Keyword;
					ht[SkipText] = _Skip.PropertyNames.SkipText;
					ht[SkipDate] = _Skip.PropertyNames.SkipDate;
					ht[SkipNumber] = _Skip.PropertyNames.SkipNumber;

				}
				return (string)ht[columnName];
			}

			static private Hashtable ht = null;			 
		}
		#endregion
		
		#region PropertyNames
		public class PropertyNames
		{  
            public const string ID = "ID";
            public const string Keyword = "Keyword";
            public const string SkipText = "SkipText";
            public const string SkipDate = "SkipDate";
            public const string SkipNumber = "SkipNumber";

			static public string ToColumnName(string propertyName)
			{
				if(ht == null)
				{
					ht = new Hashtable();
					
					ht[ID] = _Skip.ColumnNames.ID;
					ht[Keyword] = _Skip.ColumnNames.Keyword;
					ht[SkipText] = _Skip.ColumnNames.SkipText;
					ht[SkipDate] = _Skip.ColumnNames.SkipDate;
					ht[SkipNumber] = _Skip.ColumnNames.SkipNumber;

				}
				return (string)ht[propertyName];
			}

			static private Hashtable ht = null;			 
		}			 
		#endregion	

		#region StringPropertyNames
		public class StringPropertyNames
		{  
            public const string ID = "s_ID";
            public const string Keyword = "s_Keyword";
            public const string SkipText = "s_SkipText";
            public const string SkipDate = "s_SkipDate";
            public const string SkipNumber = "s_SkipNumber";

		}
		#endregion		
		
		#region Properties
	
		public virtual int ID
	    {
			get
	        {
				return base.Getint(ColumnNames.ID);
			}
			set
	        {
				base.Setint(ColumnNames.ID, value);
			}
		}

		public virtual string Keyword
	    {
			get
	        {
				return base.Getstring(ColumnNames.Keyword);
			}
			set
	        {
				base.Setstring(ColumnNames.Keyword, value);
			}
		}

		public virtual string SkipText
	    {
			get
	        {
				return base.Getstring(ColumnNames.SkipText);
			}
			set
	        {
				base.Setstring(ColumnNames.SkipText, value);
			}
		}

		public virtual DateTime SkipDate
	    {
			get
	        {
				return base.GetDateTime(ColumnNames.SkipDate);
			}
			set
	        {
				base.SetDateTime(ColumnNames.SkipDate, value);
			}
		}

		public virtual int SkipNumber
	    {
			get
	        {
				return base.Getint(ColumnNames.SkipNumber);
			}
			set
	        {
				base.Setint(ColumnNames.SkipNumber, value);
			}
		}


		#endregion
		
		#region String Properties
	
		public virtual string s_ID
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.ID) ? string.Empty : base.GetintAsString(ColumnNames.ID);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.ID);
				else
					this.ID = base.SetintAsString(ColumnNames.ID, value);
			}
		}

		public virtual string s_Keyword
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.Keyword) ? string.Empty : base.GetstringAsString(ColumnNames.Keyword);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.Keyword);
				else
					this.Keyword = base.SetstringAsString(ColumnNames.Keyword, value);
			}
		}

		public virtual string s_SkipText
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.SkipText) ? string.Empty : base.GetstringAsString(ColumnNames.SkipText);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.SkipText);
				else
					this.SkipText = base.SetstringAsString(ColumnNames.SkipText, value);
			}
		}

		public virtual string s_SkipDate
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.SkipDate) ? string.Empty : base.GetDateTimeAsString(ColumnNames.SkipDate);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.SkipDate);
				else
					this.SkipDate = base.SetDateTimeAsString(ColumnNames.SkipDate, value);
			}
		}

		public virtual string s_SkipNumber
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.SkipNumber) ? string.Empty : base.GetintAsString(ColumnNames.SkipNumber);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.SkipNumber);
				else
					this.SkipNumber = base.SetintAsString(ColumnNames.SkipNumber, value);
			}
		}


		#endregion		
	
		#region Where Clause
		public class WhereClause
		{
			public WhereClause(BusinessEntity entity)
			{
				this._entity = entity;
			}
			
			public TearOffWhereParameter TearOff
			{
				get
				{
					if(_tearOff == null)
					{
						_tearOff = new TearOffWhereParameter(this);
					}

					return _tearOff;
				}
			}

			#region WhereParameter TearOff's
			public class TearOffWhereParameter
			{
				public TearOffWhereParameter(WhereClause clause)
				{
					this._clause = clause;
				}
				
				
				public WhereParameter ID
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.ID, Parameters.ID);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter Keyword
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.Keyword, Parameters.Keyword);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter SkipText
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.SkipText, Parameters.SkipText);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter SkipDate
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.SkipDate, Parameters.SkipDate);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter SkipNumber
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.SkipNumber, Parameters.SkipNumber);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}


				private WhereClause _clause;
			}
			#endregion
		
			public WhereParameter ID
		    {
				get
		        {
					if(_ID_W == null)
	        	    {
						_ID_W = TearOff.ID;
					}
					return _ID_W;
				}
			}

			public WhereParameter Keyword
		    {
				get
		        {
					if(_Keyword_W == null)
	        	    {
						_Keyword_W = TearOff.Keyword;
					}
					return _Keyword_W;
				}
			}

			public WhereParameter SkipText
		    {
				get
		        {
					if(_SkipText_W == null)
	        	    {
						_SkipText_W = TearOff.SkipText;
					}
					return _SkipText_W;
				}
			}

			public WhereParameter SkipDate
		    {
				get
		        {
					if(_SkipDate_W == null)
	        	    {
						_SkipDate_W = TearOff.SkipDate;
					}
					return _SkipDate_W;
				}
			}

			public WhereParameter SkipNumber
		    {
				get
		        {
					if(_SkipNumber_W == null)
	        	    {
						_SkipNumber_W = TearOff.SkipNumber;
					}
					return _SkipNumber_W;
				}
			}

			private WhereParameter _ID_W = null;
			private WhereParameter _Keyword_W = null;
			private WhereParameter _SkipText_W = null;
			private WhereParameter _SkipDate_W = null;
			private WhereParameter _SkipNumber_W = null;

			public void WhereClauseReset()
			{
				_ID_W = null;
				_Keyword_W = null;
				_SkipText_W = null;
				_SkipDate_W = null;
				_SkipNumber_W = null;

				this._entity.Query.FlushWhereParameters();

			}
	
			private BusinessEntity _entity;
			private TearOffWhereParameter _tearOff;
			
		}
	
		public WhereClause Where
		{
			get
			{
				if(_whereClause == null)
				{
					_whereClause = new WhereClause(this);
				}
		
				return _whereClause;
			}
		}
		
		private WhereClause _whereClause = null;	
		#endregion
	
		#region Aggregate Clause
		public class AggregateClause
		{
			public AggregateClause(BusinessEntity entity)
			{
				this._entity = entity;
			}
			
			public TearOffAggregateParameter TearOff
			{
				get
				{
					if(_tearOff == null)
					{
						_tearOff = new TearOffAggregateParameter(this);
					}

					return _tearOff;
				}
			}

			#region AggregateParameter TearOff's
			public class TearOffAggregateParameter
			{
				public TearOffAggregateParameter(AggregateClause clause)
				{
					this._clause = clause;
				}
				
				
				public AggregateParameter ID
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.ID, Parameters.ID);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter Keyword
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.Keyword, Parameters.Keyword);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter SkipText
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.SkipText, Parameters.SkipText);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter SkipDate
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.SkipDate, Parameters.SkipDate);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter SkipNumber
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.SkipNumber, Parameters.SkipNumber);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}


				private AggregateClause _clause;
			}
			#endregion
		
			public AggregateParameter ID
		    {
				get
		        {
					if(_ID_W == null)
	        	    {
						_ID_W = TearOff.ID;
					}
					return _ID_W;
				}
			}

			public AggregateParameter Keyword
		    {
				get
		        {
					if(_Keyword_W == null)
	        	    {
						_Keyword_W = TearOff.Keyword;
					}
					return _Keyword_W;
				}
			}

			public AggregateParameter SkipText
		    {
				get
		        {
					if(_SkipText_W == null)
	        	    {
						_SkipText_W = TearOff.SkipText;
					}
					return _SkipText_W;
				}
			}

			public AggregateParameter SkipDate
		    {
				get
		        {
					if(_SkipDate_W == null)
	        	    {
						_SkipDate_W = TearOff.SkipDate;
					}
					return _SkipDate_W;
				}
			}

			public AggregateParameter SkipNumber
		    {
				get
		        {
					if(_SkipNumber_W == null)
	        	    {
						_SkipNumber_W = TearOff.SkipNumber;
					}
					return _SkipNumber_W;
				}
			}

			private AggregateParameter _ID_W = null;
			private AggregateParameter _Keyword_W = null;
			private AggregateParameter _SkipText_W = null;
			private AggregateParameter _SkipDate_W = null;
			private AggregateParameter _SkipNumber_W = null;

			public void AggregateClauseReset()
			{
				_ID_W = null;
				_Keyword_W = null;
				_SkipText_W = null;
				_SkipDate_W = null;
				_SkipNumber_W = null;

				this._entity.Query.FlushAggregateParameters();

			}
	
			private BusinessEntity _entity;
			private TearOffAggregateParameter _tearOff;
			
		}
	
		public AggregateClause Aggregate
		{
			get
			{
				if(_aggregateClause == null)
				{
					_aggregateClause = new AggregateClause(this);
				}
		
				return _aggregateClause;
			}
		}
		
		private AggregateClause _aggregateClause = null;	
		#endregion
	
		protected override IDbCommand GetInsertCommand() 
		{
		
			OleDbCommand cmd = new OleDbCommand();
			cmd.CommandType = CommandType.StoredProcedure;
			cmd.CommandText = "[" + this.SchemaStoredProcedure + "proc_SkipInsert]";
	
			CreateParameters(cmd);
			    
			return cmd;
		}
	
		protected override IDbCommand GetUpdateCommand()
		{
		
			OleDbCommand cmd = new OleDbCommand();
			cmd.CommandType = CommandType.StoredProcedure;
			cmd.CommandText = "[" + this.SchemaStoredProcedure + "proc_SkipUpdate]";
	
			CreateParameters(cmd);
			      
			return cmd;
		}
	
		protected override IDbCommand GetDeleteCommand()
		{
		
			OleDbCommand cmd = new OleDbCommand();
			cmd.CommandType = CommandType.StoredProcedure;
			cmd.CommandText = "[" + this.SchemaStoredProcedure + "proc_SkipDelete]";
	
			OleDbParameter p;
			p = cmd.Parameters.Add(Parameters.ID);
			p.SourceColumn = ColumnNames.ID;
			p.SourceVersion = DataRowVersion.Current;

  
			return cmd;
		}
		
		private IDbCommand CreateParameters(OleDbCommand cmd)
		{
			OleDbParameter p;
		
			p = cmd.Parameters.Add(Parameters.ID);
			p.SourceColumn = ColumnNames.ID;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.Keyword);
			p.SourceColumn = ColumnNames.Keyword;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.SkipText);
			p.SourceColumn = ColumnNames.SkipText;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.SkipDate);
			p.SourceColumn = ColumnNames.SkipDate;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.SkipNumber);
			p.SourceColumn = ColumnNames.SkipNumber;
			p.SourceVersion = DataRowVersion.Current;


			return cmd;
		}
	}
}
